package com.financial.service.heemoney.utils;

import com.financial.service.heemoney.utils.apiresult.ApiResult;

import java.util.Map;

/**
 * @api {post}
 * @apiExample author zhaopengjun
 * tar 对汇收银请求回执进行统一封装
 * date   2019/12/17 15:49
 * @apiGroup
 * @apiVersion 1.0.0
 * @apiHeader
 * @apiParam
 * @apiSuccess
 */
public class ResultUtils {
    public static ApiResult resultStr(String str){
        Map<String, Object> strMap = JsonUtils.jsonToMap(str);
        if(null != strMap && strMap.get("return_code").equals("SUCCESS")
                && strMap.get("result_code").equals("SUCCESS")){
            return ApiResult.success(strMap);
        }
        return ApiResult.failure(strMap);
    }
}
